<template>
  <div>
    <el-table
      :data="megList"
      style="width: 100%"
      max-height="350"
      stripe
    >

      <el-table-column
        prop="groupId"
        label="群号"
        width="180"
        fixed
      />

      <el-table-column
        prop="fromId"
        label="账号"
        width="180"
      />

      <el-table-column
        prop="nick"
        label="昵称"
      />

      <el-table-column
        prop="message"
        label="消息"
      />

      <el-table-column
        fixed="right"
        label="操作"
        width="250"
      >
        <template slot-scope="scope">
          <el-button
            type="text"
            size="small"
            @click="agree(scope.row)"
          >同意好友</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>

import { respNewFriendRequestEvent } from '@/api/bot'

export default {
  components: {

  },
  props: {
    megList: {
      type: Array,
      default() {
        return []
      }
    }
  },
  data() {
    return {

    }
  },
  methods: {
    agree(item) {
      respNewFriendRequestEvent(item).then(res => {
        console.log(res)
        this.$emit('agreeFriend')
      }).catch(err => {
        console.log(err)
      })
    }
  }
}
</script>

<style scoped>

</style>
